package org.bigjava.biz.impl;

import org.bigjava.bean.Admin;
import org.bigjava.biz.AdminService;
import org.bigjava.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("adminService")
public class AdminServiceImpl implements AdminService {

    @Qualifier("adminMapper")
    @Autowired
    AdminMapper adminMapper;

//    @Autowired
    Admin admin;

    @Override
    public Admin denglufly() {
        System.out.println("AdminService中denlulf()");
//        return adminDao.logingly("z","22");
        return admin;
    }

    @Override
    public List<Admin> cha() {
       System.out.println("service层");
        return adminMapper.cha();
//        List<Admin> list = new ArrayList<>();
//        return list;
//        Admin a = new Admin();
//        a.setId(1);
//        return a;
    }

    //管理员账号密码登录
    public Admin adminDengLu(String username,String password){
        return adminMapper.adminDengLu(username,password);
    }
    //管理员个人信息修改
    public int adminXiuGai(Admin admin){
        return adminMapper.adminXiuGai(admin);
    }
}
